﻿@model IEnumerable<Call4Pizza_reservation.Models.MealsGroup>

@{
    ViewBag.Title = "Meals groups list";
}

<h2>Meals groups list</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.description)
        </th>
        <th>
            meals
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.description)
        </td>
        <td>
            @foreach( Call4Pizza_reservation.Models.Meal ml in item.Meal  )
            {
                @Html.ActionLink(ml.name, "Edit", "Meal", new { id = ml.id }, null) @:<br />
            }
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.id })
        </td>
    </tr>
}

</table>
